/**
 * 
 */
package net.mikoo.seals.agent.common;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author huangxm
 * 
 */
public class WebContext {
	
	public static final String ADMIN_LOGIN_SESSION_KEY="agent_login_session_key";
	

	private static ThreadLocal<HttpServletRequest> _request = new ThreadLocal<HttpServletRequest>();
	
	private static ThreadLocal<HttpServletResponse> _response = new ThreadLocal<HttpServletResponse>();

	private static ThreadLocal<ServletContext> _servletContext = new ThreadLocal<ServletContext>();
	
	private static ThreadLocal<Integer> _page = new ThreadLocal<Integer>();
	
	private static ThreadLocal<String> _url = new ThreadLocal<String>();
	
	public static HttpServletRequest getRequest() {
		HttpServletRequest request = _request.get();
		return request;
	}

	public static void setRequest(HttpServletRequest request) {
		_request.set(request);
	}

	public static HttpServletResponse getResponse() {
		return _response.get();
	}
	
	public static void setResponse(HttpServletResponse response) {
		_response.set(response);
	}

	public static ServletContext getServletContext() {
		
		return _servletContext.get();
	}

	public static void setServletContext(ServletContext servletContext) {
		_servletContext.set(servletContext);
	}



	public static Integer getPage() {
		return _page.get();
	}

	public static void setPage(Integer page) {
		_page.set(page);
	}

	public static String getUrl() {
		return _url.get();
	}

	public static void setUrl(String url) {
		_url.set(url);
	}

}
